package com.eshop.logging.tools.controller;

import org.springframework.web.bind.annotation.GetMapping;
import com.eshop.annotation.AnonymousAccess;
import org.springframework.context.ApplicationEvent;
import com.eshop.logging.tools.event.NotifyEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SysInstallController
{
    @Autowired
    private WebApplicationContext webApplicationContext;
    
    @AnonymousAccess
    @GetMapping({ "/api/install" })
    public void install() throws InterruptedException {
        Thread.sleep(500L);
        final NotifyEvent event = new NotifyEvent("object");
        this.webApplicationContext.publishEvent((ApplicationEvent)event);
    }
}
